<?php
class Product_Service_QualityControlItem
{
	public static $statusText = array(
		"0" => "末开始",
		"1" => "开始质检",
		"2" => "问题处理中",
		"3" => "完成"
	);

	public static function getByCondition($condition=array(),$type='*',$order=array('qci_id'), $pageSize=0, $page=1)
	{ 
		$obj=new Product_Model_QualityControlItem();
		$rows= $obj->getByCondition( $condition,$type,$order, $pageSize,$page);	
		return $rows;
	}
	
	public function getAdapter(){
		$model = new Product_Model_QualityControlItem();
		return $model->getAdapter();
	}
	
	public static function add($row){
		$model = new Product_Model_QualityControlItem();
		return $model->add($row);
	}
	
	public static function update($row,$id){
		$model = new Product_Model_QualityControlItem();
		return $model->update($row,$id);
	}
	
	public static function delete($qco_id){
		$model = new Product_Model_QualityControlItem();
		return $model->delete($qco_id);
	}
	
	public static function deleteByQcoCode($qco_code){
		$model = new Product_Model_QualityControlItem();
		return $model->deleteByQcoCode($qco_code);
	}
	
	/*
	*根据Qco_code及产品ID,获取信息
	*/
	public static function getByQcoCodeAndProductId($qco_code,$product_id){
		$model = new Product_Model_QualityControlItem();
		return $model->getByQcoCodeAndProductId($qco_code,$product_id);
	}
	
	public static function getQcoCodeAll($qco_code){
		$model = new Product_Model_QualityControlItem();
		return $model->getQcoCodeAll($qco_code)->toArray();
	}
	
}